#include <cstdio>
#include <cstring>
#include <stack> 
using namespace std;
int swap(char c)
{
	if(c=='+') return 1;
	else if(c=='-') return 1;
	else if(c=='*') return 2;
	else if(c=='/') return 2;
	else return 0;
}
int cmp(char a,char b)
{
	int n,m;
	n = swap(a);
	m = swap(b);
	if(n<=m) return 1;
	else return 0;	
}
double cnt(double a,double b,char c)
{
	if(c=='+') return a+b;
	else if(c=='-') return a-b;
	else if(c=='*') return a*b;
	else return a/b;
}
int main()
{
	char str[202];
	while(gets(str))
	{
		if(!strcmp(str,"0"))return 0;
		char c;
		stack<double>num;
		stack<char>op;
		double temp=0;
		int len = strlen(str);
		str[len] = '#';
		for(int i = 0;i<len;i++)
	{
	
		if(str[i]>='0'&&str[i]<='9')
		{
			temp=0;
			while(str[i]>='0'&&str[i]<='9')
			{
				temp = temp*10+str[i]-'0';
				i++;
			}
			num.push(temp);
		}
		if(str[i]==' ')
		{
			continue;
		}
		else
		{
			if(op.empty())
			{
				//printf("*****\n");
				op.push(str[i]);
			}
			else
			{
			//	printf("***\n");
			//	printf("%c ",str[i]);
				while(cmp(str[i],op.top()))
				{
					
					c = op.top();
				//	printf("%c\n",c);
					double a,b,ans;
					a = num.top();
					num.pop();
					b = num.top();
					num.pop();
					//printf("%.2f %.2f\n",a,b);
					ans = cnt(b,a,c);
					num.push(ans);
				//	printf("%.2f\n",ans);
					op.pop();
					if(op.empty()) break;
				}
				op.push(str[i]);
			}
		}
	}
	printf("%.2f\n",num.top());
	num.pop();
	}
}
